package framework;
/**
 * @Author:DarknessShadow
 * @description:工厂，用来生成产品和注册产品
 * @date 2020/5/11 13:46
 */
public abstract class Factory {

    public final Product create(String owner) {
        Product p = createProduct(owner);
        registerProduct(p);
        return p;
    }

    protected abstract Product createProduct(String owner);

    protected abstract void registerProduct(Product product);
}
